package com.l2qq.common.caffeine;

import com.jfinal.plugin.activerecord.cache.ICache;

/**
 * Caffeine 缓存
 * <p>
 * ActiveRecordPlugin arp = new ActiveRecordPlugin(...);
 * arp.setCache(new CaffeineCache());
 *
 * @author 杜福忠
 */
public class CaffeineCache implements ICache {

    @Override
    public <T> T get(String cacheName, Object key) {
        return CaffeineKit.get(cacheName, key);
    }

    @Override
    public void put(String cacheName, Object key, Object value) {
        CaffeineKit.put(cacheName, key, value);
    }

    @Override
    public void remove(String cacheName, Object key) {
        CaffeineKit.remove(cacheName, key);
    }

    @Override
    public void removeAll(String cacheName) {
        CaffeineKit.removeAll(cacheName);
    }
}